<div class="bjui-pageContent tableContent">
  <table class="table table-bordered table-hover table-striped table-top">
    <thead>
      <tr>
        <!--  排序 快递名称 备注说明 状态 操作   -->
        <th data-order-field="sort" align="center">排序</th>
        <th>快递名称</th>
        <th>备注说明</th>
        <th data-order-field="status" align="center">状态</th>
        <th align="center">操作</th>
      </tr>
    </thead>
    <tbody>
      <?php foreach($list as $arr):?>
      <tr>
        <!-- 排序 -->
        <td align="center">{$arr.sort}</td>
        <!-- 快递名称 -->
        <td align="center">{$arr.name}</td>
        <!-- 备注说明 -->
        <td align="center">{$arr.description}</td>
        <!-- 状态 -->
        <td align="center">{$arr.status}</td>
        <!-- 操作 -->
        <td>
            <a class="btn btn-red" data-toggle="navtab"
               data-options="{id:'Express{$arr.id}', url:'{:U('expressPrintTemplate?navTabId=Express'.$arr['id'].'&expressId='.$arr['id'])}', title:'{$arr.name}-设置通用打印模版设计'}">设置通用打印模版设计</a>
            <?php if($arr['id']==C('DEFAULT_EXPRESS')):?>
            <a href="{:U('Config/setDefaultConfig?name=DEFAULT_EXPRESS&value=0')}" class="btn btn-red" data-toggle="doajax">取消默认快递</a>
            <?php else:?>
            <a href="{:U('Config/setDefaultConfig?name=DEFAULT_EXPRESS&value='.$arr['id'])}" class="btn btn-green" data-toggle="doajax">指定默认快递</a>
            <?php endif;?>
        </td>
      </tr>
      <?php endforeach;?></tbody>
  </table>
</div>
<div class="bjui-pageFooter">
  <div class="pages">
    <span>每页&nbsp;</span>
    <div class="selectPagesize">
      <select data-toggle="selectpicker" data-toggle-change="changepagesize">
        <option value="{$pageSize}">{$pageSize}</option>
        <option value="{$pageSize*3}">{$pageSize*3}</option>
        <option value="{$pageSize*6}">{$pageSize*6}</option>
        <option value="{$pageSize*12}">{$pageSize*12}</option>
        <option value="{$pageSize*15}">{$pageSize*15}</option>
      </select>
    </div>
    <span>&nbsp;条，共 {$total} 条</span>
  </div>
  <div class="pagination-box" data-toggle="pagination" data-total="{$total}" data-page-size="{$pageSize}"
         data-page-current="{$pageCurrent}"></div>
</div>
<script>
    /**
     *  显示[打印快递单]页面
     */
    function printListIndex(result){
        var expressName = $(".in select[name=express_id]  option:selected").text();
        var data = {};
        data['expressId'] = $(".in select[name=express_id]").val();
        data['ids'] = result['data']['ids']
        $(this).navtab({id:'printListIndex', url:"{:U('printListIndex')}", title:'打印快递单-'+expressName, type:'POST', data:data});
    }

    /**
     *  显示[打印快递单]-前-操作
     */
    function checkPrint(){
        var expressId = $(".in select[name=express_id]").val();
        if(Number(expressId)>0){
            return true;
        }
        $(this).alertmsg('warn', "请选择选择快递方式");
        return false;
    }
</script>